3.19 \(\int \sqrt{a+b \cos (x)} \tan (x) \, dx\)

Optimal. Leaf size=37 \[ 2 \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a+b \cos (x)}}{\sqrt{a}}\right )-2 \sqrt{a+b \cos (x)} \]

[Out]

2*Sqrt[a]*ArcTanh[Sqrt[a + b*Cos[x]]/Sqrt[a]] - 2*Sqrt[a + b*Cos[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0574767, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.308, Rules used = {2721, 50, 63, 207} \[ 2 \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a+b \cos (x)}}{\sqrt{a}}\right )-2 \sqrt{a+b \cos (x)} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + b*Cos[x]]*Tan[x],x]

[Out]

2*Sqrt[a]*ArcTanh[Sqrt[a + b*Cos[x]]/Sqrt[a]] - 2*Sqrt[a + b*Cos[x]]

Rule 2721

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{a+b \cos (x)} \tan (x) \, dx &=-\operatorname{Subst}\left (\int \frac{\sqrt{a+x}}{x} \, dx,x,b \cos (x)\right )\\ &=-2 \sqrt{a+b \cos (x)}-a \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+x}} \, dx,x,b \cos (x)\right )\\ &=-2 \sqrt{a+b \cos (x)}-(2 a) \operatorname{Subst}\left (\int \frac{1}{-a+x^2} \, dx,x,\sqrt{a+b \cos (x)}\right )\\ &=2 \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a+b \cos (x)}}{\sqrt{a}}\right )-2 \sqrt{a+b \cos (x)}\\ \end{align*}

Mathematica [A]  time = 0.0219488, size = 37, normalized size = 1. \[ 2 \sqrt{a} \tanh ^{-1}\left (\frac{\sqrt{a+b \cos (x)}}{\sqrt{a}}\right )-2 \sqrt{a+b \cos (x)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + b*Cos[x]]*Tan[x],x]

[Out]

2*Sqrt[a]*ArcTanh[Sqrt[a + b*Cos[x]]/Sqrt[a]] - 2*Sqrt[a + b*Cos[x]]

________________________________________________________________________________________

Maple [A]  time = 0.096, size = 30, normalized size = 0.8 \begin{align*} 2\,{\it Artanh} \left ({\frac{\sqrt{a+b\cos \left ( x \right ) }}{\sqrt{a}}} \right ) \sqrt{a}-2\,\sqrt{a+b\cos \left ( x \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cos(x))^(1/2)*tan(x),x)

[Out]

2*arctanh((a+b*cos(x))^(1/2)/a^(1/2))*a^(1/2)-2*(a+b*cos(x))^(1/2)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(x))^(1/2)*tan(x),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.69519, size = 311, normalized size = 8.41 \begin{align*} \left [\frac{1}{2} \, \sqrt{a} \log \left (-\frac{b^{2} \cos \left (x\right )^{2} + 8 \, a b \cos \left (x\right ) + 4 \,{\left (b \cos \left (x\right ) + 2 \, a\right )} \sqrt{b \cos \left (x\right ) + a} \sqrt{a} + 8 \, a^{2}}{\cos \left (x\right )^{2}}\right ) - 2 \, \sqrt{b \cos \left (x\right ) + a}, -\sqrt{-a} \arctan \left (\frac{2 \, \sqrt{b \cos \left (x\right ) + a} \sqrt{-a}}{b \cos \left (x\right ) + 2 \, a}\right ) - 2 \, \sqrt{b \cos \left (x\right ) + a}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(x))^(1/2)*tan(x),x, algorithm="fricas")

[Out]

[1/2*sqrt(a)*log(-(b^2*cos(x)^2 + 8*a*b*cos(x) + 4*(b*cos(x) + 2*a)*sqrt(b*cos(x) + a)*sqrt(a) + 8*a^2)/cos(x)
^2) - 2*sqrt(b*cos(x) + a), -sqrt(-a)*arctan(2*sqrt(b*cos(x) + a)*sqrt(-a)/(b*cos(x) + 2*a)) - 2*sqrt(b*cos(x)
 + a)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a + b \cos{\left (x \right )}} \tan{\left (x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(x))**(1/2)*tan(x),x)

[Out]

Integral(sqrt(a + b*cos(x))*tan(x), x)

________________________________________________________________________________________

Giac [A]  time = 1.32117, size = 46, normalized size = 1.24 \begin{align*} -\frac{2 \, a \arctan \left (\frac{\sqrt{b \cos \left (x\right ) + a}}{\sqrt{-a}}\right )}{\sqrt{-a}} - 2 \, \sqrt{b \cos \left (x\right ) + a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(x))^(1/2)*tan(x),x, algorithm="giac")

[Out]

-2*a*arctan(sqrt(b*cos(x) + a)/sqrt(-a))/sqrt(-a) - 2*sqrt(b*cos(x) + a)